package com.niit.TopOne.othertopone;

import com.niit.bean.OtherTopOneBean;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class OtherGroupingComparator extends WritableComparator {
    protected OtherGroupingComparator() {
        super(OtherTopOneBean.class, true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        OtherTopOneBean aBean = (OtherTopOneBean) a;
        OtherTopOneBean bBean = (OtherTopOneBean) b;
        return aBean.getcity().compareTo(bBean.getcity());
    }
}